<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>设备信息</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<style type="text/css">
		 .left-label {
		 	width: 100px !important
		 }
	</style>
	<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/layui.css"  media="all">
	<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/toastr.min.css"  media="all">
</head>
<body>
<div class="demoTable" style="padding:10px 0 0 15px">
    <div class="layui-inline">
    	<%--<input class="layui-input" name="searchTime" id="searchTime" placeholder="请输入时间检索" style="display: inline; width: 45%">--%>
        <input class="layui-input" name="keyword" id="keyword" placeholder="请输入设备名称" autocomplete="off" style="display: inline; width: 100%">
    </div>
    <button class="layui-btn layui-btn-blue" style="margin: 0 0 0 10px" data-type="reload"><i class="layui-icon layui-icon-search">搜索</i></button>
</div>
<table class="layui-hide" id="tableList" lay-filter="tableList"></table>

<script type="text/html" id="toolbar">
	<div class="layui-btn-container">
		<button class="layui-btn layui-btn-blue" lay-event="add"><i class="layui-icon layui-icon-add-1">新增</i></button>
		<button class="layui-btn layui-btn-blue" lay-event="delete"><i class="layui-icon layui-icon-delete">批量删除</i></button>
	</div>
</script>
 
<script type="text/html" id="rowToolbar">
	<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
	<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
              
<script src="${pageContext.request.contextPath }/assets/layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath }/assets/layui.all.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath }/assets/js/jquery.min.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath }/assets/js/toastr.min.js" charset="utf-8"></script>
 
<script type="text/javascript">
	layui.use(['table','layer','upload','form','laydate'], function(){
		var table = layui.table;
		var layer = layui.layer;
		var laydate = layui.laydate;
	    var form = layui.form;
	    
		var $ = layui.jquery, active = {
			reload:function () {
				/*var searchTime = $("#searchTime").val();*/
				var keyword01 = $("#keyword").val();
				/*console.log(searchTime + ',' + keyword)*/
				table.reload('contenttable',{
					method:'get',
					where:{"keyword01":keyword01},
					page: {
						curr: 1
					}
				});
			}
		}
		$('.layui-btn').on('click', function(){
	        var type = $(this).data('type');
	        active[type] ? active[type].call(this) : '';
	    });

		table.render({
		    elem: '#tableList'
		    ,url:'${pageContext.request.contextPath }/device/queryDeviceInfo.do'
		    ,toolbar: '#toolbar'
		    ,title: '设备信息'
		    ,id :'contenttable'
		    ,limits:[10,20,30]
		    ,cols: [[
		      {type: 'checkbox', fixed: 'left', },
		      {field:'', title:'序号', sort: true, type:'numbers', width: 60},
		      {field:'deviceNo', title:'设备编号'},
		      {field:'deviceName', title:'名称'},
		      {field:'deviceVersion', title:'型号'},
		      {field:'deviceSize', title:'外形尺寸'},
		      {field:'deviceWeight', title:'重量'},
		      {field:'deviceSource', title:'电源'},
		      {field:'devicePower', title:'功率'},
		      {field:'manufacturers', title:'制造厂家'},
		      {field:'outTime', title:'出厂日期'},
		      {field:'maxSpeed', title:'最高转速'},
		      {field:'motor', title:'电机'},
		      {field:'totalNoise', title:'整机噪声'},
		      {field:'twiceDevelop', title:'支持二次开发'},
		      {field:'buyTime', title:'购买日期'},
		      {field:'cylinderSpeed', title:'气缸推送速度'},
		      {field:'maxThreadSpeed', title:'最大运行线速度'},
		      {field:'remark01', title:'类型'},
		      {fixed: 'right', title:'操作', width: 130, toolbar: '#rowToolbar'}
		    ]],
		    page: true
		});
	  
		//头工具栏事件
		table.on('toolbar(tableList)', function(obj){
			var checkStatus = table.checkStatus(obj.config.id);
		    switch(obj.event){
                //新增
		    	case 'add':
			    	layer.open({
						type: 1 					//Page层类型
				  		,area: ['670px', '450px'] 		//宽  高
				  		,title: '新增'
				  		,shade: 0.6 				//遮罩透明度
				  		,maxmin: true 				//允许全屏最小化
				  		,anim: 1 					//0-6的动画形式，-1不开启
				  		/* ,content: $("#addDivID") */
				  		,content: '<div id="addDivID">'+
				  			'<form class="layui-form" id="addFormID">'+
								'<table>'+
									'<tr style="margin-top: 20px">'+
										'<td><label class="layui-form-label left-label" style="margin-top: 20px">设备编号</label></td>'+
										'<td><input class="layui-input" id="deviceNo" name="deviceNo" lay-verify="deviceNo" style="width:150px; margin-top:20px; display:inline;">'+
                            				'<div class="layui-inline" style="margin-top: 4px;">'+
												'<font style="color:red; font-size: 24px; margin-left: 4px">*</font>'+
											'</div>'+
										'</td>'+
										'<td><label class="layui-form-label" style="margin-top: 20px">名称</label></td>'+
										'<td><input class="layui-input" id="deviceName" name="deviceName" lay-verify="deviceName" style="width:150px; margin-top:20px; display:inline;">' +
											'<div class="layui-inline" style="margin-top: 4px;">'+
												'<font style="color:red; font-size: 24px; margin-left: 4px">*</font>'+
											'</div>'+
										'</td>'+
									'</tr>'+
									'<tr style="height:20px"></tr>'+
									'<tr>'+
										'<td>&emsp;&emsp;&emsp;&emsp;型号&emsp;</td>'+
										'<td><input class="layui-input" id="deviceVersion" name="deviceVersion" lay-verify="deviceVersion" style="width:150px"></td>'+
										'<td>&emsp;&emsp;&emsp;&emsp;外形尺寸&emsp;</td>'+
										'<td><input class="layui-input" id="deviceSize" name="deviceSize" lay-verify="deviceSize" style="width:150px"></td>'+
									'</tr>'+
									'<tr style="height:20px"></tr>'+
									'<tr>'+
										'<td>&emsp;&emsp;&emsp;&emsp;重量&emsp;</td>'+
										'<td><input class="layui-input" id="deviceWeight" name="deviceWeight" lay-verify="deviceWeight" style="width:150px"></td>'+
										'<td>&emsp;&emsp;&emsp;&emsp;电源&emsp;</td>'+
										'<td><input class="layui-input" id="deviceSource" name="deviceSource" lay-verify="deviceSource" style="width:150px"></td>'+
									'</tr>'+
									'<tr style="height:20px"></tr>'+
									'<tr>'+
										'<td>&emsp;&emsp;&emsp;&emsp;功率&emsp;</td>'+
										'<td><input class="layui-input" id="devicePower" name="devicePower" lay-verify="devicePower" style="width:150px"></td>'+
										'<td>&emsp;&emsp;&emsp;&emsp;制造厂家&emsp;</td>'+
										'<td><input class="layui-input" id="manufacturers" name="manufacturers" lay-verify="manufacturers" style="width:150px"></td>'+
									'</tr>'+
									'<tr style="height:20px"></tr>'+
									'<tr>'+
										'<td>&emsp;&emsp;&emsp;&emsp;出厂日期&emsp;</td>'+
										'<td><input class="layui-input" id="outTime" name="outTime" lay-verify="outTime" style="width:150px"></td>'+
										'<td>&emsp;&emsp;&emsp;&emsp;最高转速&emsp;</td>'+
										'<td><input class="layui-input" id="maxSpeed" name="maxSpeed" lay-verify="maxSpeed" style="width:150px"></td>'+
									'</tr>'+
									'<tr style="height:20px"></tr>'+
									'<tr>'+
										'<td>&emsp;&emsp;&emsp;&emsp;电机&emsp;</td>'+
										'<td><input class="layui-input" id="motor" name="motor" lay-verify="motor" style="width:150px"></td>'+
										'<td>&emsp;&emsp;&emsp;&emsp;整机噪声&emsp;</td>'+
										'<td><input class="layui-input" id="totalNoise" name="totalNoise" lay-verify="totalNoise" style="width:150px"></td>'+
									'</tr>'+
									'<tr style="height:20px"></tr>'+
									'<tr>'+
										'<td>&emsp;&emsp;&emsp;&emsp;支持二次开发&emsp;</td>'+
										'<td><input class="layui-input" id="twiceDevelop" name="twiceDevelop" lay-verify="twiceDevelop" style="width:150px"></td>'+
										'<td>&emsp;&emsp;&emsp;&emsp;购买日期&emsp;</td>'+
										'<td><input class="layui-input" id="buyTime" name="buyTime" lay-verify="buyTime" style="width:150px"></td>'+
									'</tr>'+
									'<tr style="height:20px"></tr>'+
									'<tr>'+
										'<td>&emsp;&emsp;&emsp;&emsp;气缸推送速度&emsp;</td>'+
										'<td><input class="layui-input" id="cylinderSpeed" name="cylinderSpeed" lay-verify="cylinderSpeed" style="width:150px"></td>'+
										'<td>&emsp;&emsp;&emsp;&emsp;最大运行线速度&emsp;</td>'+
										'<td><input class="layui-input" id="maxThreadSpeed" name="maxThreadSpeed" lay-verify="maxThreadSpeed" style="width:150px"></td>'+
									'</tr>'+
									'<tr style="height:20px"></tr>'+
									'<tr>'+
										'<td>&emsp;&emsp;&emsp;&emsp;类型&emsp;</td>'+
										'<td><input class="layui-input" id="remark01" name="remark01" lay-verify="remark01" style="width:150px"></td>'+
										'<td></td>'+
										'<td></td>'+
									'</tr>'+
									'<tr style="height:20px"></tr>'+
									'<tr align="center">'+
										'<td colspan="2"><button class="layui-btn layui-btn-blue" id="subBtn" lay-submit lay-filter="addForm" style="margin-left:160px; margin-bottom: 20px">提交</button></td>'+
										'<td colspan="2">&emsp;&emsp;&emsp;&emsp;<button id="cleanEditForm" class="layui-btn layui-btn-primary" style="margin-bottom: 20px">重置</button></td>'+
									'</tr>'+
								'</table>'+
							'</form>'+
						'</div>'
				  		/* ,end: function(){
				  			$("#addDivID").hide();
				  		} */
				  		,success: function(){
				  			//出厂日期
				  			laydate.render({
				  			    elem: '#outTime'
				  			});
				  			//购买日期
				  			laydate.render({
				  			    elem: '#buyTime'
				  			});
				  		}
					});
		      	break;
		      	//批量删除
		    	case 'delete':
		        	var data = checkStatus.data;
		        	var idArr = new Array();
		        	if(data.length == 0){
		        		toastr.warning("请至少选择一条记录！");
		        	}
		        	for(var i=0;i < data.length;i++){
		        		/*alert(data[i].id)*/
						idArr[i] = data[i].id;
		        	}
                    $.ajax({
                        type:'post',
                        url:'${pageContext.request.contextPath }/device/deleteDeviceById.do',
                        data:{"idArr" : idArr},
                        success:function(data){
                            layer.confirm('确定删除吗？', function(index){
                                if(data > 0){
                                	toastrStyle();
                                    toastr.success("删除成功！");
                                    setTimeout(function(){
        								location.reload();
                                    },1000);
                                }else{
                                	toastrStyle();
                                    toastr.warning("删除失败！");
                                    setTimeout(function(){
        								location.reload();
                                    },1000);
                                }
							});
                        }
                    });
		      	break;
		      	case 'select':
		      		/*console.log(obj)*/
		      	break;
		    };
		});
	  
		//监听行工具事件
		table.on('tool(tableList)', function(obj){
			var data = obj.data;
            var idArr = new Array();
			//单个删除
			if(obj.event === 'del'){
			  layer.confirm('确定删除吗？', function(index){
			    var id = obj.data.id;
			    idArr[0] = id;
			    $.ajax({
			    	type:'post',
			    	url:'${pageContext.request.contextPath }/device/deleteDeviceById.do',
                    data:{ "idArr" : idArr },
			    	success:function(data){
			    		if(data > 0){
                            toastrStyle();
                            toastr.success("删除成功！");
                            setTimeout(function(){
								location.reload();
                            },1000);
			    		}else{
                            toastrStyle();
                            toastr.warning("删除失败！");
                            setTimeout(function(){
								location.reload();
                            },1000);
			    		}
			    	}
			    });
			    layer.close(index);
			  });
			} else if(obj.event === 'edit'){
				layer.open({
				  type: 1 						//Page层类型
				  ,area: ['640px', '450px']			//宽  高
				  ,title: '编辑'
				  ,shade: 0.6 					//遮罩透明度
				  ,maxmin: true 				//允许全屏最小化
				  ,anim: 1 						//0-6的动画形式，-1不开启
				  ,content: '<form class="layui-form" id="editFormID">'+
				  	'<table>'+
				  		'<tr>'+
							'<td><input class="layui-hide" id="id" name="id" value="'+data.id+'"></td>'+
						'</tr>'+
						/* 
						'<label class="layui-form-label left-label" style="width:100px">设备编号</label>'+
						'<div class="layui-input-block" style="width: 300px; margin-left: 130px">'+
							'<select name="deviceNo" lay-verify="deviceNo" id="deviceNo1">'+
								'<option value="">请选择</option>'+
							'</select>'+
						'</div><br>'+ 
						*/
						'<tr>'+
							'<td><label class="layui-form-label left-label" style="margin-top: 20px">设备编号</label></td>'+
                        	'<td><input class="layui-input" id="deviceNo" name="deviceNo" value="'+data.deviceNo+'" lay-verify="deviceNo" style="width:150px; margin-top:20px; display:inline;">'+
							'<div class="layui-inline" style="margin-top: 4px;">'+
								'<font style="color:red; font-size: 24px; margin-left: 4px">*</font>'+
							'</div>'+
						'</td>'+
							'<td><label class="layui-form-label left-label" style="margin-top: 20px">名称</label></td>'+
							'<td><input class="layui-input" id="deviceName" name="deviceName" value="'+data.deviceName+'" lay-verify="deviceName" style="width:150px; margin-top: 20px; display:inline;">' +
							'<div class="layui-inline" style="margin-top: 4px;">'+
								'<font style="color:red; font-size: 24px; margin-left: 4px">*</font>'+
							'</div>'+
						'</td>'+
						'<tr>'+
						'<tr style="height:20px"></tr>'+
						'<tr>'+
							'<td><label class="layui-form-label left-label">型号</label></td>'+
							'<td><input class="layui-input" id="deviceVersion" name="deviceVersion" value="'+data.deviceVersion+'" lay-verify="deviceVersion" style="width:150px"></td>'+
							'<td><label class="layui-form-label left-label">外形尺寸</label></td>'+
							'<td><input class="layui-input" id="deviceSize" name="deviceSize" value="'+data.deviceSize+'" lay-verify="deviceSize" style="width:150px"></td>'+
						'<tr>'+
						'<tr style="height:20px"></tr>'+
						'<tr>'+
							'<td><label class="layui-form-label left-label">重量</label></td>'+
							'<td><input class="layui-input" id="deviceWeight" name="deviceWeight" value="'+data.deviceWeight+'" lay-verify="deviceWeight" style="width:150px"></td>'+
							'<td><label class="layui-form-label left-label">电源</label></td>'+
							'<td><input class="layui-input" id="deviceSource" name="deviceSource" value="'+data.deviceSource+'" lay-verify="deviceSource" style="width:150px"></td>'+
						'<tr>'+
						'<tr style="height:20px"></tr>'+
						'<tr>'+
							'<td><label class="layui-form-label left-label">功率</label></td>'+
							'<td><input class="layui-input" id="devicePower" name="devicePower" value="'+data.devicePower+'" lay-verify="devicePower" style="width:150px"></td>'+
							'<td><label class="layui-form-label left-label">制造厂家</label></td>'+
							'<td><input class="layui-input" id="manufacturers" name="manufacturers" value="'+data.manufacturers+'" lay-verify="manufacturers" style="width:150px"></td>'+
						'<tr>'+
						'<tr style="height:20px"></tr>'+
						'<tr>'+
							'<td><label class="layui-form-label left-label">出厂日期</label></td>'+
							'<td><input class="layui-input" id="outTime" name="outTime" value="'+data.outTime+'" lay-verify="outTime" style="width:150px"></td>'+
							'<td><label class="layui-form-label left-label">最高转速</label></td>'+
							'<td><input class="layui-input" id="maxSpeed" name="maxSpeed" value="'+data.maxSpeed+'" lay-verify="maxSpeed" style="width:150px"></td>'+
						'<tr>'+
						'<tr style="height:20px"></tr>'+
						'<tr>'+
							'<td><label class="layui-form-label left-label">电机</label></td>'+
							'<td><input class="layui-input" id="motor" name="motor" value="'+data.motor+'" lay-verify="motor" style="width:150px"></td>'+
							'<td><label class="layui-form-label left-label">整机噪声</label></td>'+
							'<td><input class="layui-input" id="totalNoise" name="totalNoise" value="'+data.totalNoise+'" lay-verify="totalNoise" style="width:150px"></td>'+
						'<tr>'+
						'<tr style="height:20px"></tr>'+
						'<tr>'+
							'<td><label class="layui-form-label left-label">支持二次开发</label></td>'+
							'<td><input class="layui-input"id="twiceDevelop" name="twiceDevelop" value="'+data.twiceDevelop+'" lay-verify="twiceDevelop" style="width:150px"></td>'+
							'<td><label class="layui-form-label left-label">购买日期</label></td>'+
							'<td><input class="layui-input" id="buyTime" name="buyTime" value="'+data.buyTime+'" lay-verify="buyTime" style="width:150px"></td>'+
						'<tr>'+
						'<tr style="height:20px"></tr>'+
						'<tr>'+
							'<td><label class="layui-form-label left-label">气缸推送速度</label></td>'+
							'<td><input class="layui-input" id="cylinderSpeed" name="cylinderSpeed" value="'+data.cylinderSpeed+'" lay-verify="cylinderSpeed" style="width:150px"></td>'+
							'<td><label class="layui-form-label left-label">最大运行线速度</label></td>'+
							'<td><input class="layui-input"	id="maxThreadSpeed" name="maxThreadSpeed" value="'+data.maxThreadSpeed+'" lay-verify="maxThreadSpeed" style="width:150px"></td>'+
						'<tr>'+
						'<tr style="height:20px"></tr>'+
						'<tr>'+
							'<td><label class="layui-form-label left-label">类型</label></td>'+
							'<td><input class="layui-input" id="remark01" name="remark01" value="'+data.remark01+'" lay-verify="remark01" style="width:150px"></td>'+
							'<td></td>'+
							'<td></td>'+
						'<tr>'+
						'<tr style="height:20px"></tr>'+
						'<tr align="center">'+
							'<td colspan="2"><button class="layui-btn layui-btn-blue" lay-submit lay-filter="editForm" style="margin-left:160px; margin-bottom: 20px">提交</button></td>'+
							'<td colspan="2">&emsp;&emsp;&emsp;&emsp;<button type="reset" class="layui-btn layui-btn-primary" style="margin-bottom: 20px">重置</button></td>'+
						'<tr>'+
					'</table>'+
					'</form>'
				,success: function(){
					//出厂日期
					laydate.render({
					    elem: '#outTime'
					  });
					//购买日期
					laydate.render({
					    elem: '#buyTime'
					});
				}
			});
		}
	});

	    /**
         * 通用表单提交(AJAX方式)(新增)
         */
	    form.on('submit(addForm)', function (data) {
	    	$("#subBtn").attr("disabled",true);
	    		$.ajax({
					url : '${pageContext.request.contextPath}/device/addDeviceInfo.do',
	                data: $("#addFormID").serialize(),
					cache : false,
					type : "post",
					}).done(
						function(res) {
							if (res > 0) {
	                            toastrStyle();
	                            toastr.success('新增成功！');
	                            setTimeout(function(){
	                                location.reload();
	                            },1000);
							}
						}
					).fail(
						function(res) {
	                        toastrStyle();
	                        toastr.error('新增失败！');
	                        setTimeout(function(){
								location.reload();
	                        },1000);
						}
					)
				return false;
	    });
	    /**
	     * 通用表单提交(AJAX方式)(修改)
	     */
	    form.on('submit(editForm)', function (data) {
	    	$.ajax({
				url : '${pageContext.request.contextPath}/device/editDeviceInfoById.do',
                data: $("#editFormID").serialize(),
				cache : false,
				type : "post",
				}).done(
					function(res) {
						if (res > 0) {
                            toastrStyle();
                            toastr.success('修改成功！');
							setTimeout(function(){
								location.reload();
                            },1000);
						}
					}
				).fail(
					function(res) {
                        toastrStyle();
                        toastr.error('修改失败！');
                        setTimeout(function(){
							location.reload();
                        },1000);
					}
				)
				return false;
	    });
	  	//时间检索
	    laydate.render({
	      elem: '#searchTime',
	      format: 'yyyy-MM-dd'
	    });
		
        /**
         * 新增表单校验
         */
        form.verify({
            //value：表单的值item：表单的DOM对象
            deviceNo: function(value, item){
                if(value == ''){
                    return '设备编号不能为空';
                }
            },
            deviceName: function(value, item){
                if(value == ''){
                    return '名称不能为空';
                }
            }/* ,
            deviceVersion: function(value, item){
                if(value == ''){
                    return '型号字段不能为空';
                }
            },
            deviceSize: function(value, item){
                if(value == ''){
                    return '外形尺寸字段不能为空';
                }
            },
            deviceWeight: function(value, item){
                if(value == ''){
                    return '重量字段不能为空';
                }
            },
            deviceSource: function(value, item){
                if(value == ''){
                    return '电源字段不能为空';
                }
            },
            devicePower: function(value, item){
                if(value == ''){
                    return '功率字段不能为空';
                }
            },
            manufacturers: function(value, item){
                if(value == ''){
                    return '制造厂家字段不能为空';
                }
            },
            outTime: function(value, item){
                if(value == ''){
                    return '出厂日期字段不能为空';
                }
            },
            maxSpeed: function(value, item){
                if(value == ''){
                    return '最高转速字段不能为空';
                }
            },
            motor: function(value, item){
                if(value == ''){
                    return '电机字段不能为空';
                }
            },
            totalNoise: function(value, item){
                if(value == ''){
                    return '整机噪声字段不能为空';
                }
            },
            twiceDevelop: function(value, item){
                if(value == ''){
                    return '支持二次开发字段不能为空';
                }
            },
            buyTime: function(value, item){
                if(value == ''){
                    return '购买日期字段不能为空';
                }
            },
            cylinderSpeed: function(value, item){
                if(value == ''){
                    return '气缸推送速度字段不能为空';
                }
            },
            maxThreadSpeed: function(value, item){
                if(value == ''){
                    return '最大运行线速度字段不能为空';
                }
            },
            remark01: function(value, item){
                if(value == ''){
                    return '类型字段不能为空';
                }
            } */
        });
        
        //查找带回
        form.on('select(displayInfo)', function(data){
        	$.ajax({
                type: 'POST',
                url: '${pageContext.request.contextPath}/device/queryDeviceInfoByNo.do',
                data: {deviceNo:$('#deviceNo').val()},
                /* dataType: 'json', */
                /* async: false, */
                success: function (data){
                	var device = eval('(' +data+ ')');
                	$('#deviceName').val(device.deviceName);
                	$('#deviceVersion').val(device.deviceVersion);
                	$('#deviceSize').val(device.deviceSize);
                	$('#deviceWeight').val(device.deviceWeight);
                	$('#deviceSource').val(device.deviceSource);
                	$('#devicePower').val(device.devicePower);
                	$('#manufacturers').val(device.manufacturers);
                	$('#outTime').val(device.outTime);
                	$('#maxSpeed').val(device.maxSpeed);
                	$('#motor').val(device.motor);
                	$('#totalNoise').val(device.totalNoise);
                	$('#twiceDevelop').val(device.twiceDevelop);
                	$('#buyTime').val(device.buyTime);
                	$('#cylinderSpeed').val(device.cylinderSpeed);
                	$('#maxThreadSpeed').val(device.maxThreadSpeed);
                	$('#remark01').val(device.remark01);
                }
            });
        });
        
        $.ajax({
            type: 'POST',
            url: '${pageContext.request.contextPath}/device/queryAllDeviceList.do',
            dataType: 'json',
            async: false,
            success: function (data){
                for (var i = 0; i < data.length; i++) {
                    $("#deviceNo").append("<option value='"+ data[i].deviceNo +"'>"+ data[i].deviceNo +"</option>");
                }
            }
	    });
		form.render();
	});
	toastr.options.positionClass = 'toast-top-center'; //提示框的位置设置为中上

    //提示框样式
    function toastrStyle(){
        toastr.options = {
            "closeButton": false,
            "debug": false,
            "newestOnTop": false,
            "progressBar": false,
            "positionClass": "toast-top-center",
            "preventDuplicates": false,
            "onclick": null,
            "showDuration": "5000",
            "hideDuration": "1000",
            "timeOut&quot": "100000",
            "extendedTimeOut": "0",
            "showEasing": "swing",
            "hideEasing": "linear",
            "showMethod": "fadeIn",
            "hideMethod": "fadeOut"
        };
    }
</script>

</body>
</html>